<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.sql.*" errorPage=""%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta nnme="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
	<jsp:useBean id="LogBean" scope="session" class="Bean.dbConn"/>
<%
request.setCharacterEncoding("UTF-8");

String mynumber = request.getParameter("mynumber");
String myname = request.getParameter("myname");
String mysex = request.getParameter("mysex");
String myclass = request.getParameter("myclass");
String mybri = request.getParameter("mybri");
String mybril = request.getParameter("mybril");

ResultSet rs = null;

	int sum = LogBean.executeUpdate("INSERT INTO user(number,name,sex,class,bri,bril) VALUES (" + 
	"'" + mynumber + "'" + "," +
	"'" + myname + "'" + "," +
	"'" + mysex + "'" + "," +
	"'" + myclass + "'" + "," + 
	"'" + mybri + "'" + "," + 
	"'" + mybril + "'" + ")");
	

	rs = LogBean.executeQuery("SELECT * FROM user where number=" + "'"+ mynumber +"'");
	rs.next();
	String myid = rs.getString("id");
	session.setAttribute("userid",myid);
	
	
	LogBean.closeConn();
	response.sendRedirect("dotest.jsp");



%>

</body>
</html>